<?php
include_once 'url.conf.php';
include_once 'dbconnect.php';

$sql = new ownedsql;

function genGallery($rid)
{
    global $upload, $sql;
    
    $sql->connect();
    $sql->query("SELECT iid, iFile FROM 3i_rest_images WHERE rid='$rid' AND iActive='1' AND iType='full'");
    $resultFull = $sql->query;
    
    ?>
    <?php
    
    while ($full = mysql_fetch_array($resultFull)) {
        $fullID = $full['iid'];
        
        $file = $full['iFile'];
        
        $sql->query("SELECT iid, iFile FROM 3i_rest_images WHERE rid='$rid' AND iActive='1' AND iType='thumb' AND iFile='$file'");
        $resultThumb = $sql->query;
        $thumb = mysql_fetch_array($resultThumb);        
        $thumbID = $thumb['iid'];

        ?>
        <a href="core/function.rest.image.php?iid=<?php echo $fullID ?>" rel="shadowbox[Ingatlan]; player=img" ><div id="galleryImg" style="background-image: url('core/function.rest.image.php?iid=<?php echo $thumbID ?>'); background-position: center center; background-repeat: no-repeat;"></div></a>
        <?php
    }
    
    ?>
    <?php  
    $sql->kill();
}

?>